<?php
class StuhomeworkModel extends Model
{
	public function addStuhomework($stu_id, $hw_id, $point, $rating, $link)
	{
		$stuhomework['hw_id'] = $hw_id;
		$stuhomework['stu_id'] = $stu_id;
		$stuhomework['point'] = $point;
		$stuhomework['rating'] = $rating;
		$stuhomework['link'] = $link;
		
		return $this->add($stuhomework);
		
	}
	
	public function getById($stu_id, $hw_id)
	{
		$condition['stu_id'] = $stu_id;
		$condition['hw_id'] = $hw_id;
		$stuhomework = $this->where($condition)->find();
		return $stuhomework;
	}
}
?>